package xin.marcher.module.inventory.api;

import xin.marcher.module.common.core.JsonResult;
import xin.marcher.module.inventory.domain.request.InventoryRequest;
import xin.marcher.module.inventory.domain.request.WarningInventoryRequest;

/**
 * 库存对外服务
 */
public interface InventoryServiceApi {

    /**
     * 库存预警消息通知
     *
     * @param request
     * @return
     */
    JsonResult warningInventoryMessage(WarningInventoryRequest request);

    /**
     * 扣减商品库存
     *
     * @param request
     * @return
     */
    JsonResult deductProductStock(InventoryRequest request);

    /**
     * 取消订单 回退商品库存
     *
     * @param request
     * @return
     */
    JsonResult cancelProductStock(InventoryRequest request);

    /**
     * 执行分桶操作
     *
     * @return
     */
    JsonResult processBucketOperate();

    /**
     * 清除分桶操作执行成功的任务
     *
     * @return
     */
    JsonResult bucketOperateFinishedClear();

    /**
     * 定时刷新下线分桶的库存阈值
     *
     * @return
     */
    JsonResult calculateOfflineThreshold();
}
